package be.xios.projectquiz.cards;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Font;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

/// <summary>
/// Deze klasse is JPANEL die kan gebruikt worden in cardlayouts en info displayed op de initiele GUI's 
/// </summary>
/// <author>Sebastian Kubski</author>
///	<author>Robin Crombe: Gradient als achtergrond toegevoegd</author>
@SuppressWarnings("serial")
public class Connect extends JPanel {

	private JLabel connectLabel;
	
	public Connect() {
		this.setLayout(new BorderLayout());

		connectLabel = new JLabel("Please connect", JLabel.HORIZONTAL){
			protected void paintComponent(Graphics grphcs) {
                Graphics2D g2d = (Graphics2D) grphcs;
                g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                        RenderingHints.VALUE_ANTIALIAS_ON);

                GradientPaint gp = new GradientPaint(0, 0, getBackground().brighter().brighter(), getWidth(), getHeight(), getBackground().darker().darker());

                g2d.setPaint(gp);
                g2d.fillRect(0, 0, getWidth(), getHeight());

				super.paintComponent(grphcs);
            }
        };
		connectLabel.setFont(new Font("Euphemia", Font.BOLD, 25));
		connectLabel.setBorder(BorderFactory.createLineBorder(Color.BLACK,3));
		connectLabel.setOpaque(false);
		
		add(connectLabel, BorderLayout.CENTER);		
	}
}
